require 'MVVM.Sources.View.GUIView'
require 'MVVM.Sources.View.Adaptors.InputFieldAdaptor'
require 'MVVM.Sources.View.Adaptors.ButtonAdaptor'
require 'ViewModel.Login.LoginViewModel'

LoginView = class('LoginView', GUIView)
function LoginView:InitPanel()
    GUIView.InitPanel(self)
    InputFieldAdaptor.new(self.transform:Find('UsernameInput'), 'Username', self.Binder)
    InputFieldAdaptor.new(self.transform:Find('PasswordInput'), 'Password', self.Binder)
    ButtonAdaptor.new(self.transform:Find('RegisterBtn'), 'OnClickRegister', self.Binder)
    ButtonAdaptor.new(self.transform:Find('LoginBtn'), 'OnClickLogin', self.Binder)
end

function LoginView:OnStart()
    self:Set_BindingContext(LoginViewModelInstance)
end